{extend name="mainadmin@layouts/base" /}
{block name="main" }

<header class="header  b-b clearfix">
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="fa fa-ellipsis-v"></i>
                <strong>{$row['proxy_id']<1?'添加代理层级':'编缉代理层级'}</strong>
            </li>
        </ul>
        <a class="text-muted pull-right m-r-tm m-t-md pointer" data-toggle="back" title="返回"><i class="fa fa-reply"></i></a>
    </div>
</header>
<form class="form-horizontal form-validate form_vbox" method="post" action="{:url('info')}">
    <section class="vbox">
        <section class="scrollable  wrapper w-f">
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">代理层级名称：</label>
                        <div class="col-sm-3 must ">
                            <input type="text" class="input-max" data-rule-maxlength="30" data-rule-required="true" data-msg-required="代理层级名称不能为空" name="proxy_name" value="{$row.proxy_name}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">归属上级：</label>
                        <div class="col-sm-7">
                            <select name="pid" data-toggle="select2" data-notsearch="true"  style="width: 150px; ">
                                <option value="0" {$row['pid']==0?'selected':''}>厂家</option>
                                {volist name="proxy_list" id="vo"}
                                    <option value="{$vo.proxy_id}" {$row['pid']==$vo['proxy_id']?'selected':''}>{$vo.proxy_name}</option>
                                {/volist}
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">供货上级：</label>
                        <div class="col-sm-7">
                            <select name="supply_pid" data-toggle="select2" data-notsearch="true"  style="width: 150px; ">
                                <option value="0" {$row['supply_pid']==0?'selected':''}>厂家</option>
                                {volist name="proxy_list" id="vo"}
                                <option value="{$vo.proxy_id}" {$row['supply_pid']==$vo['proxy_id']?'selected':''}>{$vo.proxy_name}</option>
                                {/volist}
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">自动审核：</label>
                        <div class="col-sm-7 ">
                            <label class="radio-inline">
                                <input type="radio" name="is_auto_check" value="1" {$row.is_auto_check|tplckval='=1','checked'}/>启用</label>
                            <label class="radio-inline">
                                <input type="radio" name="is_auto_check" value="0" {$row.is_auto_check|tplckval='=0','checked',true}/>不启用</label>
                            <span class="tooltip-darkorange fa fa-question-circle" data-toggle="tooltip"  data-placement="bottom" data-html="true" data-original-title="启用自动审核后，代理注册申请会自动完成审核"></span>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注信息：</label>
                        <div class="col-sm-7">
                            <textarea name="remarks" style="height: 50px" class="input-max" ></textarea>
                        </div>
                    </div>
                    <div class="line line-dashed line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否可被邀请：</label>
                        <div class="col-sm-7 ">
                            <label class="radio-inline">
                                <input type="radio" name="is_invite" value="1" {$row.is_invite|tplckval='=1','checked'} class="js_radio_undertake"
                                data-class="is_invite_box"/>是</label>
                            <label class="radio-inline">
                                <input type="radio" name="is_invite" value="0"  {$row.is_invite|tplckval='=0','checked',true} class="js_radio_undertake"
                                />否</label>
                        </div>
                    </div>
                    <div class="form-group radio_undertake_is_invite is_invite_box {$row['is_invite']==0?'hide':''}">
                        <label class="col-sm-2 control-label">加入门槛：</label>
                        <div class="col-sm-9 ">
                            <div class="input-group ">
                                <label class="radio-inline">
                                    <input type="radio" name="is_join_limit" value="1" {$row.is_join_limit|tplckval='=1','checked'} class="js_radio_undertake"
                                    data-class="is_join_limit_box"/>开启门槛</label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_join_limit" value="0"  {$row.is_join_limit|tplckval='=0','checked',true} class="js_radio_undertake"
                                    />无门槛-任意加入</label>
                            </div>
                            <div class="form-group radio_undertake_is_join_limit is_join_limit_box {$row['is_join_limit']==0?'hide':''}">
                                <div class="input-group form-group-addon">
                                    <label><input type="checkbox" class="check_input_disabled" name="join_uplevel_goods_money_limit" {$row['join_uplevel_goods_money_limit']==1?'checked':''} value="1" >完成充值【升级货款】金额</label>
                                </div>
                                <div class="input-group form-group-addon ">
                                    <label><input type="checkbox" class="check_input_disabled" name="join_earnest_money_limit" {$row['join_earnest_money_limit']==1?'checked':''} value="1">充值保证金要求</label><input type="text" class="input-mmini" name="join_earnest_money" data-rule-min="1" data-rule-number="true" data-rule-required="true" {$row['join_earnest_money_limit']==1?'':'disabled'}  value="{$row['join_earnest_money']|default=0}" > <span class="input-group-addon">元</span>
                                </div>
                                <div class="input-group form-group-addon">
                                    <label><input type="checkbox" class="check_input_disabled" name="join_goods_money_limit" {$row['join_goods_money_limit']==1?'checked':''} value="1" >充值货款要求</label><input type="text" class="input-mmini" name="join_payment_goods" data-rule-min="1" data-rule-number="true" data-rule-required="true" {$row['join_goods_money_limit']==1?'':'disabled'} value="{$row['join_payment_goods']|default=0}" > <span class="input-group-addon">元</span>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">升级方式：</label>
                        <div class="col-sm-9">
                            <label class="radio-inline">
                                <input type="radio" name="upgrade_type" value="1" {$row.upgrade_type|tplckval='=1','checked'} class="js_radio_undertake"
                                data-class="upgrade_setting" />条件升级</label>
                            <label class="radio-inline">
                                <input type="radio" name="upgrade_type" value="0" {$row.upgrade_type|tplckval='=0','checked',true} class="js_radio_undertake"/>手动调整</label>
                        </div>
                    </div>
                    <div class="radio_undertake_upgrade_type upgrade_setting {$row['upgrade_type']==0?'hide':''}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">升级政策：</label>
                            <div class="col-sm-9">
                                <div class="input-group ">
                                    指定层级：
                                    <select multiple="multiple" name="upgrade_limit_proxy[]" data-toggle="select2" style="min-width: 500px;">
                                        {volist name="proxy_list" id="vo"}
                                        {if condition="$vo['level']>$row['level']"}
                                        <option value="{$vo.proxy_id}" {:in_array($vo['proxy_id'],$row['upgrade_limit_proxy'])?'selected':''}>{$vo.proxy_name}</option>
                                        {/if}
                                        {/volist}
                                    </select><span class="tooltip-darkorange fa fa-question-circle" data-toggle="tooltip"   data-placement="bottom" data-html="true" data-original-title="选择可以申请该层级的下级层级，不设置为不限制"></span>
                                </div>
                                <div class="input-group m-t-mc">
                                    同时满足：<label>
                                    <input class="checkbox-slider colored-orange " name="upgrade_all_limit" {$row['upgrade_all_limit']==1?'checked':''} type="checkbox" value="1" >
                                    <span class="text"></span>
                                </label><span class="tooltip-darkorange fa fa-question-circle" data-toggle="tooltip"  data-placement="bottom" data-html="true" data-original-title="开启后需要同时满足以下条件"></span>
                                </div>
                                <div class="input-group form-group-addon">
                                    <label><input type="checkbox" name="upgrade_uplevel_goods_money_limit" {$row['upgrade_uplevel_goods_money_limit']==1?'checked':''} class="check_input_disabled" value="1">完成充值【升级货款】金额</label>
                                </div>
                                <div class="input-group form-group-addon hide">
                                    <label><input type="checkbox" name="upgrade_earnest_money_limit" {$row['upgrade_earnest_money_limit']==1?'checked':''} class="check_input_disabled" value="1">充值保证金要求，累计</label><input type="text" class="input-mmini" name="upgrade_earnest_money" data-rule-min="0" data-rule-number="true" data-rule-required="true" {$row['upgrade_earnest_money_limit']==1?'':'disabled'} value="{$row['upgrade_earnest_money']}"> <span class="input-group-addon">元</span>
                                </div>
                                <div class="input-group form-group-addon">
                                    <label><input type="checkbox" name="upgrade_team_limit" {$row['upgrade_team_limit']==1?'checked':''}  class="check_input_disabled"  value="1">团队构成要求值</label>直推：<input type="text" class="input-smini" name="upgrade_direct_push_num" {$row['upgrade_team_limit']==1?'':'disabled'} data-rule-min="0" data-rule-number="true" value="{$row.upgrade_direct_push_num}" > <span class="input-group-addon">人</span>，
                                    <select  data-toggle="select2" data-notsearch="true" name="upgrade_team_proxy_id"  style="width: 150px; margin-right: 5px;">
                                        <option value="0" >不限制</option>
                                        {volist name="proxy_list" id="vo"}
                                        {if condition="$vo['level']>=$row['level']"}
                                        <option value="{$vo.proxy_id}" {$vo['proxy_id']==$row['upgrade_team_proxy_id']?'selected':''}>{$vo.proxy_name}</option>
                                        {/if}
                                        {/volist}
                                    </select><input type="text" class="input-smini" name="upgrade_team_proxy_num" {$row['upgrade_team_limit']==1?'':'disabled'} data-rule-min="0" data-rule-number="true" value="{$row.upgrade_team_proxy_num}" > <span class="input-group-addon">人</span>
                                    ，团队总数：<input type="text" class="input-smini" name="upgrade_team_all_num" {$row['upgrade_team_limit']==1?'':'disabled'} data-rule-min="0" data-rule-number="true" value="{$row.upgrade_team_all_num}" > <span class="input-group-addon">人</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="line line-dashed line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">进货设置：</label>
                        <div class="col-sm-9">
                            <label class="radio-inline">
                                <input type="radio" name="purchase_setting" value="1" {$row.purchase_setting|tplckval='=1','checked'}/>云仓</label>
                            <label class="radio-inline">
                                <input type="radio" name="purchase_setting" value="2" {$row.purchase_setting|tplckval='=2','checked',true}/>现货</label>
                            <label class="radio-inline">
                                <input type="radio" name="purchase_setting" value="3" {$row.purchase_setting|tplckval='=3','checked'}/>复合（云仓+现货）</label>
                            <span class="tooltip-darkorange fa fa-question-circle" data-toggle="tooltip"  data-placement="bottom" data-html="true" data-original-title="选择云仓那么代理将货物暂存到云仓库内，按需提货，现货代理必须直接下单发货，混合模式两种都可以，特别注意定义云仓时，上一个层级也必须开启云仓"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">邀请设置：</label>
                        <div class="col-sm-9">
                            <label class="radio-inline">
                                <input type="radio" name="invite_setting" value="1" {$row.invite_setting|tplckval='=1','checked'}/>任意级别</label>
                            <label class="radio-inline">
                                <input type="radio" name="invite_setting" value="2" {$row.invite_setting|tplckval='=2','checked'}/>同级和下级</label>
                            <label class="radio-inline">
                                <input type="radio" name="invite_setting" value="3" {$row.invite_setting|tplckval='=3','checked',true}/>仅下级</label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">充值升级货款：</label>
                        <div class="col-sm-9">
                            <div class="fl input-group form-group-addon">
                                <input type="text" class="input-mmini" name="uplevel_goods_money" data-rule-min="0" data-rule-number="true" data-rule-required="true" value="{$row['uplevel_goods_money']|default=0}" > <span class="input-group-addon">元</span>
                            </div>
                            <div class="fl nput-group form-group-addon">
                                ，升级货款实到帐<input type="text" class="input-mmini" name="uplevel_goods_money_arrive" data-rule-min="0" data-rule-number="true" data-rule-required="true" value="{$row['uplevel_goods_money_arrive']|default=0}" > <span class="input-group-addon">元</span>
                            </div>
                        </div>
                    </div>

                    <div class="form-group hide">
                        <label class="col-sm-2 control-label">订单要求：</label>
                        <div class="col-sm-9 ">
                            <div class="input-group form-group-addon">
                                <label>首笔现货订单要求</label><input type="text" class="input-mmini" name="order_first_spot_money" data-rule-min="0" data-rule-number="true"  value="{$row.order_first_spot_money}" >
                                <span class="input-group-addon">元</span>
                            </div>
                            <div class="input-group form-group-addon">
                                <label>首笔云仓订单要求</label><input type="text" class="input-mmini" name="order_first_cloud_money" data-rule-min="0" data-rule-number="true" value="{$row.order_first_cloud_money}"  >
                                <span class="input-group-addon">元</span>
                            </div>
                            <div class="input-group form-group-addon">
                                <label>首笔云仓提货要求</label><input type="text" class="input-mmini" name="order_first_cloud_pickup_money" data-rule-min="0"data-rule-number="true"  value="{$row.order_first_cloud_pickup_money}"  >
                                <span class="input-group-addon">元</span>
                            </div>
                            <div class="input-group form-group-addon">
                                <label>二次现货补货要求</label><input type="text" class="input-mmini" name="order_patch_spot_money" data-rule-min="0" data-rule-number="true"  value="{$row.order_patch_spot_money}"  >
                                <span class="input-group-addon">元</span>
                            </div>
                            <div class="input-group form-group-addon">
                                <label>二次云仓补货要求</label><input type="text" class="input-mmini" name="order_patch_cloud_money" data-rule-min="0" data-rule-number="true" value="{$row.order_patch_cloud_money}"  >
                                <span class="input-group-addon">元</span>
                            </div>
                            <div class="input-group form-group-addon">
                                <label>二次云仓提货要求</label><input type="text" class="input-mmini" name="order_twice_cloud_pickup_money" data-rule-min="0" data-rule-number="true"  value="{$row.order_twice_cloud_pickup_money}"  >
                                <span class="input-group-addon">元</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group hide">
                        <label class="col-sm-2 control-label">充值要求：</label>
                        <div class="col-sm-9">

                            <div class="input-group form-group-addon">
                                <label>首次货款充值不得少于</label><input type="text" class="input-mmini" name="recharge_first_money" data-rule-min="0" data-rule-number="true" value="{$row.recharge_first_money}" > <span class="input-group-addon">元</span>
                            </div>
                            <div class="input-group form-group-addon">
                                <label>每次货款充值不得少于</label><input type="text" class="input-mmini" name="recharge_each_money" data-rule-min="0" data-rule-number="true" value="{$row.recharge_each_money}" > <span class="input-group-addon">元</span>
                            </div>
                        </div>
                    </div>

                </div>
            </section>
        </section>
        <footer class="footer bg-white b-t p-t">
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-1">
                    <input name="proxy_id" type="hidden" value="{$row.proxy_id|intval}">
                    <button type="submit" class="btn btn-primary js_save_submit" data-loading-text="保存中...">保存</button>
                    <button type="button" class="btn btn-default" data-toggle="back">取消</button>
                </div>
            </div>
        </footer>
    </section>
</form>
{/block}

